# This file is part of BlackArch Linux ( https://www.blackarch.org/ ).
# See COPYING for license details.

pkgbase=python-pygoogle
pkgname=('python2-pygoogle' 'python-pygoogle')
_pkgname=pygoogle
pkgver=0.6
pkgrel=10
pkgdesc='This module lets you search the Google search engine programmatically.'
arch=('any')
url='https://pypi.python.org/pypi/pygoogle/'
license=('BSD')
makedepends=('python2-setuptools' 'python-setuptools')
source=("https://files.pythonhosted.org/packages/source/${_pkgname::1}/$_pkgname/$_pkgname-$pkgver.tar.gz")
sha512sums=('ed3246da24b16942ff13ab98f03082bcf545b36ca6c30b9d473d6a225b6f6b859187052388f5cf89e9e272a0101d6c4efda35365d19611a079a8ab94b0b3b2b3')

prepare() {
  cp -a "$_pkgname-$pkgver"{,-2}
}

build() {
  cd "$_pkgname-$pkgver-2"

  python2 setup.py build

  cd "$srcdir/$_pkgname-$pkgver"

  python setup.py build
}

package_python2-pygoogle() {
  depends=('python2')

  cd "$_pkgname-$pkgver-2"

  python2 setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

package_python-pygoogle() {
  depends=('python')

  cd "$_pkgname-$pkgver"

  python setup.py install --root="$pkgdir" --prefix=/usr -O1 --skip-build
}

